home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ für Kids
/
C++ for kids.iso
/
SETUP
/
US
/
CBUILDER
/
DATA.Z
/
SHELLAPI.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-02-13
|
20KB
|
501 lines
{*******************************************************}
{ }
{ Delphi Runtime Library }
{ Windows 32bit API Interface Unit }
{ }
{ Copyright (c) 1992,96 Borland International }
{ }
{*******************************************************}
unit ShellAPI;
interface
uses Windows;
type
HDROP = Longint;
{$nonamespace HDROP}
PPWideChar = ^PWideChar;
function DragQueryFileA(Drop: HDROP; FileIndex: UINT; FileName: PAnsiChar; cb: UINT): UINT; stdcall;
function DragQueryFileW(Drop: HDROP; FileIndex: UINT; FileName: PWideChar; cb: UINT): UINT; stdcall;
function DragQueryFile(Drop: HDROP; FileIndex: UINT; FileName: PChar; cb: UINT): UINT; stdcall;
function DragQueryPoint(Drop: HDROP; var Point: TPoint): BOOL; stdcall;
procedure DragFinish(Drop: HDROP); stdcall;
procedure DragAcceptFiles(Wnd: HWND; Accept: BOOL); stdcall;
function ShellExecuteA(hWnd: HWND; Operation, FileName, Parameters,
Directory: PAnsiChar; ShowCmd: Integer): HINST; stdcall;
function ShellExecuteW(hWnd: HWND; Operation, FileName, Parameters,
Directory: PWideChar; ShowCmd: Integer): HINST; stdcall;
function ShellExecute(hWnd: HWND; Operation, FileName, Parameters,
Directory: PChar; ShowCmd: Integer): HINST; stdcall;
function FindExecutableA(FileName, Directory: PAnsiChar; Result: PAnsiChar): HINST; stdcall;
function FindExecutableW(FileName, Directory: PWideChar; Result: PWideChar): HINST; stdcall;
function FindExecutable(FileName, Directory: PChar; Result: PChar): HINST; stdcall;
function CommandLineToArgvW(lpCmdLine: LPCWSTR; var pNumArgs: Integer): PPWideChar; stdcall;
function ShellAboutA(Wnd: HWND; szApp, szOtherStuff: PAnsiChar; Icon: HICON): Integer; stdcall;
function ShellAboutW(Wnd: HWND; szApp, szOtherStuff: PWideChar; Icon: HICON): Integer; stdcall;
function ShellAbout(Wnd: HWND; szApp, szOtherStuff: PChar; Icon: HICON): Integer; stdcall;
function DuplicateIcon(hInst: HINST; Icon: HICON): HICON; stdcall;
function ExtractAssociatedIconA(hInst: HINST; lpIconPath: PAnsiChar;
var lpiIcon: Word): HICON; stdcall;
function ExtractAssociatedIconW(hInst: HINST; lpIconPath: PWideChar;
var lpiIcon: Word): HICON; stdcall;
function ExtractAssociatedIcon(hInst: HINST; lpIconPath: PChar;
var lpiIcon: Word): HICON; stdcall;
function ExtractIconA(hInst: HINST; lpszExeFileName: PAnsiChar;
nIconIndex: UINT): HICON; stdcall;
function ExtractIconW(hInst: HINST; lpszExeFileName: PWideChar;
nIconIndex: UINT): HICON; stdcall;
function ExtractIcon(hInst: HINST; lpszExeFileName: PChar;
nIconIndex: UINT): HICON; stdcall;
type
PDragInfoA = ^TDragInfoA;
PDragInfoW = ^TDragInfoW;
PDragInfo = PDragInfoA;
TDragInfoA = record
uSize: UINT; { init with SizeOf(DRAGINFO) }
pt: TPoint;
fNC: BOOL;
lpFileList: PAnsiChar;
grfKeyState: DWORD;
end;
TDragInfoW = record
uSize: UINT; { init with SizeOf(DRAGINFO) }
pt: TPoint;
fNC: BOOL;
lpFileList: PWideChar;
grfKeyState: DWORD;
end;
TDragInfo = TDragInfoA;
const
{ AppBar stuff }
ABM_NEW = $00000000;
ABM_REMOVE = $00000001;
ABM_QUERYPOS = $00000002;
ABM_SETPOS = $00000003;
ABM_GETSTATE = $00000004;
ABM_GETTASKBARPOS = $00000005;
ABM_ACTIVATE = $00000006; { lParam = True/False means activate/deactivate }
ABM_GETAUTOHIDEBAR = $00000007;
ABM_SETAUTOHIDEBAR = $00000008; { this can fail at any time. MUST check the result
lParam = TRUE/FALSE Set/Unset
uEdge = what edge }
ABM_WINDOWPOSCHANGED = $0000009;
{ these are put in the wparam of callback messages }
ABN_STATECHANGE = $0000000;
ABN_POSCHANGED = $0000001;
ABN_FULLSCREENAPP = $0000002;
ABN_WINDOWARRANGE = $0000003; { lParam = True means hide }
{ flags for get state }
ABS_AUTOHIDE = $0000001;
ABS_ALWAYSONTOP = $0000002;
ABE_LEFT = 0;
ABE_TOP = 1;
ABE_RIGHT = 2;
ABE_BOTTOM = 3;
type
PAppBarData = ^TAppBarData;
_AppBarData = record
cbSize: DWORD;
hWnd: HWND;
uCallbackMessage: UINT;
uEdge: UINT;
rc: TRect;
lParam: LPARAM; { message specific }
end;
{$nonamespace _AppBarData}
TAppBarData = _AppBarData;
function SHAppBarMessage(dwMessage: DWORD; var pData: TAppBarData): UINT; stdcall;
function DoEnvironmentSubstA(szString: PAnsiChar; cbString: UINT): DWORD; stdcall;
function DoEnvironmentSubstW(szString: PWideChar; cbString: UINT): DWORD; stdcall;
function DoEnvironmentSubst(szString: PChar; cbString: UINT): DWORD; stdcall;
function FindEnvironmentStringA(szEnvVar: PAnsiChar): PAnsiChar; stdcall;
function FindEnvironmentStringW(szEnvVar: PWideChar): PWideChar; stdcall;
function FindEnvironmentString(szEnvVar: PChar): PChar; stdcall;
function ExtractIconExA(lpszFile: PAnsiChar; nIconIndex: Integer;
var phiconLarge, phiconSmall: HICON; nIcons: UINT): UINT; stdcall;
function ExtractIconExW(lpszFile: PWideChar; nIconIndex: Integer;
var phiconLarge, phiconSmall: HICON; nIcons: UINT): UINT; stdcall;
function ExtractIconEx(lpszFile: PChar; nIconIndex: Integer;
var phiconLarge, phiconSmall: HICON; nIcons: UINT): UINT; stdcall;
{ Shell File Operations }
const
FO_MOVE = $0001;
FO_COPY = $0002;
FO_DELETE = $0003;
FO_RENAME = $0004;
FOF_MULTIDESTFILES = $0001;
FOF_CONFIRMMOUSE = $0002;
FOF_SILENT = $0004; { don't create progress/report }
FOF_RENAMEONCOLLISION = $0008;
FOF_NOCONFIRMATION = $0010; { Don't prompt the user. }
FOF_WANTMAPPINGHANDLE = $0020; { Fill in SHFILEOPSTRUCT.hNameMappings
Must be freed using SHFreeNameMappings }
FOF_ALLOWUNDO = $0040;
FOF_FILESONLY = $0080; { on *.*, do only files }
FOF_SIMPLEPROGRESS = $0100; { means don't show names of files }
FOF_NOCONFIRMMKDIR = $0200; { don't confirm making any needed dirs }
type
FILEOP_FLAGS = Word;
{$nonamespace FILEOP_FLAGS}
const
PO_DELETE = $0013; { printer is being deleted }
PO_RENAME = $0014; { printer is being renamed }
PO_PORTCHANGE = $0020; { port this printer connected to is being changed
if this id is set, the strings received by
the copyhook are a doubly-null terminated
list of strings. The first is the printer
name and the second is the printer port. }
PO_REN_PORT = $0034; { PO_RENAME and PO_PORTCHANGE at same time. }
{ no POF_ flags currently defined }
type
PRINTEROP_FLAGS = Word;
{$nonamespace PRINTEROP_FLAGS}
{ implicit parameters are:
if pFrom or pTo are unqualified names the current directories are
taken from the global current drive/directory settings managed
by Get/SetCurrentDrive/Directory
the global confirmation settings }
PSHFileOpStructA = ^TSHFileOpStructA;
PSHFileOpStructW = ^TSHFileOpStructW;
PSHFileOpStruct = PSHFileOpStructA;
_SHFILEOPSTRUCTA = packed record
Wnd: HWND;
wFunc: UINT;
pFrom: PAnsiChar;
pTo: PAnsiChar;
fFlags: FILEOP_FLAGS;
fAnyOperationsAborted: BOOL;
hNameMappings: Pointer;
lpszProgressTitle: PAnsiChar; { only used if FOF_SIMPLEPROGRESS }
end;
{$nonamespace _SHFILEOPSTRUCTA}
TSHFileOpStructA = _SHFILEOPSTRUCTA;
_SHFILEOPSTRUCTW = packed record
Wnd: HWND;
wFunc: UINT;
pFrom: PWideChar;
pTo: PWideChar;
fFlags: FILEOP_FLAGS;
fAnyOperationsAborted: BOOL;
hNameMappings: Pointer;
lpszProgressTitle: PWideChar; { only used if FOF_SIMPLEPROGRESS }
end;
{$nonamespace _SHFILEOPSTRUCTW}
T